package com.example.springbooteasycode.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class StoreManager {

    // 假设这是 InformationTypePageVO 类的定义
    static class InformationTypePageVO {
        private String storeIds;

        public String getStoreIds() {
            return storeIds;
        }

        // 其他属性和方法...


        public void setStoreIds(String storeIds) {
            this.storeIds = storeIds;
        }
    }

    // 示例数据
    private List<InformationTypePageVO> informationTypePageVOS = new ArrayList<>();

    public void processStoreIds() {
        List<String> storeIdsList = informationTypePageVOS.stream()
                .map(InformationTypePageVO::getStoreIds)
                .map(storeIds -> Arrays.asList(storeIds.split("\\s*,\\s*")))
                .flatMap(List::stream)
                .collect(Collectors.toList());

        System.out.println(storeIdsList);
    }

    public static void main(String[] args) {
        // 示例数据初始化
        StoreManager manager = new StoreManager();
        InformationTypePageVO vo1 = new InformationTypePageVO();
        vo1.setStoreIds("111,222,333");
        InformationTypePageVO vo2 = new InformationTypePageVO();
        vo2.setStoreIds("444,555,666");

        manager.informationTypePageVOS.add(vo1);
        manager.informationTypePageVOS.add(vo2);

        manager.processStoreIds();
    }

}
